#!/bin/bash

MainPst=/home/nvidia/positec
target=slam

drive_src=("auto_slam" "camera_pub" "fusion_rtk_quat" "record_data" "serial_date" "start_robot" "zvision_ros_driver")
drive_lib=("pkgconfig" "python2.7" "auto_slam" "camera_pub" "fusion_rtk_quat" "record_data" "serial_date" "zvision_lidar_driver" "zvision_lidar_pointcloud" "librealsense2_camera.so")
slam_src=("Customized-messages" "Global-Sensor-Fusion" "LIO-Wheel" "VIW-Fusion" "multisensor_launch")
slam_lib=("pkgconfig" "lio_wheel" "pose_fusion" "vins" "camera_models" "libfmt.so.8" "libvilib.so" "pose_fusion" "libcamera_models.so"  "libfmt.so.8.1.1" "libvins_lib.so" "python2.7" "libeva_Lib.so" "libGeographic2.so" "lio_wheel" "vins" "libfmt.so" "libpose_fusion_Lib.so")
ai_src=("bboxmerge" "Customized-messages" "libcommon" "objectcluster" "prj_pointcloud" "segfusion" "slopeSeg" "seg_det" "statemonitor" "README.md")
ai_lib=("pkgconfig" "objectcluster" "prj_pointcloud" "python2.7" "seg_det" "segfusion" "slopeSeg" "statemonitor")


if [ "$target" == "slam" ];then
    for ((i=0;i<${#slam_src[*]};i++))
 	 do
		echo "${slam_src[i]}"
		#cp -rf ./robot/devel/lib/${process[i]} ${MainPst}/robot/devel/lib
       		cp -rf ./robot/src/${slam_src[i]} ${MainPst}/robot/src	
  	done
    for ((i=0;i<${#slam_lib[*]};i++))
 	 do
		echo "${slam_lib[i]}"
		cp -rf ./robot/devel/lib/${slam_lib[i]} ${MainPst}/robot/devel/lib
  	done
fi

if [ "$target" == "ai" ];then
    for ((i=0;i<${#ai_src[*]};i++))
 	 do
		echo "${ai_src[i]}"
		#cp -rf ./robot/devel/lib/${process[i]} ${MainPst}/robot/devel/lib
       		cp -rf ./robot/src/${ai_src[i]} ${MainPst}/robot/src	
  	done
    for ((i=0;i<${#ai_lib[*]};i++))
 	 do
		echo "${ai_lib[i]}"
		cp -rf ./robot/devel/lib/${ai_lib[i]} ${MainPst}/robot/devel/lib	
  	done
fi 

echo "suceess"
